<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>18-marginTop塌陷问题</title>
		<style type="text/css">
			/*
				解决方式：
				1.父元素添加overflow:hidden
				2.双伪元素清除法
			*/
			*{
				margin:0;
				padding:0;
			}
			.box{
				width: 300px;
				height: 300px;
				background:red;
				/* overflow: hidden; */
			}
			.son{
				width: 100px;
				height:100px;
				background:blue;
				margin-top:30px;
			}
			.clearfix::before,
			.clearfix::after {
				  content: '';
				  display: table;
			}
			.clearfix::after {
				clear: both;
			}
		</style>
	</head>
	<body>
		
		<div class="box clearfix">
			<div class="son"></div>
		</div>
		
		
	</body>
</html>
